package com.juc.threadPoolExecutor.threadPoolExecutor2;

import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class Test4 {

	public static void main(String[] args) throws InterruptedException {
		MyRunnable1 myRunnable =new MyRunnable1();
		ThreadPoolExecutor executor = new ThreadPoolExecutor(2, 99999, 9999L, TimeUnit.SECONDS, new LinkedBlockingDeque<Runnable>());
		executor.execute(myRunnable);
		executor.execute(myRunnable);
		executor.execute(myRunnable);
		executor.execute(myRunnable);
        Thread.sleep(1000);
        executor.shutdown();
        executor.execute(myRunnable);
        System.out.println(" main end !");
	}
}
